use std::{
    sync::OnceLock,
    time::{Duration, Instant, SystemTime},
};

pub fn now() -> Duration {
    SystemTime::now()
        .duration_since(SystemTime::UNIX_EPOCH)
        .expect("wall clock failed")
}

pub fn now_hw() -> Duration {
    static STARTING: OnceLock<Instant> = OnceLock::new();
    Instant::now().duration_since(STARTING.get_or_init(|| Instant::now()).clone())
}
